#@layout()

#define script()
<script>

    function doDel(id) {
        ajaxGet("#(CPATH)/admin/job/doDel/" + id);
    }

</script>
#end

#define content()

<!-- Content Header (Page header) -->
<section class="content-header">
    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-6">

                <div class="row mb-2">
                    <div class="col-sm-12">
                        <h1>
                            招聘岗位
                            <small data-toggle="tooltip" title="可以查看所有岗位，鼠标移到岗位标题上，可以对其编辑或删除等操作" data-placement="bottom"
                                   data-trigger="hover"><i class="nav-icon far fa-question-circle"></i></small>
                            <small> 首页 / 招聘 / 招聘岗位</small>
                        </h1>
                    </div>
                </div>

            </div>
            <div class="col-sm-6 ">
                <div class=" float-sm-right" style="padding-top: 15px">
                    <a href="#(CPATH)/admin/job/add" type="button" class="btn btn-primary"><i class="fas fa-plus"></i>新建</a>
                </div>
            </div>
        </div>

    </div>
</section>


<section class="content">
    <div class="container-fluid">
        <div class="card card-outline card-primary">
            <div class="card-header">
                <form class=" admin-search-panel" action="" method="get">
                    <div class="row">

                        <div class="form-group col-lg-2">
                            <input type="text" class="form-control" placeholder="请输入名称" name="title" value="#para('title')">
                        </div>

                        <div class="form-group col-lg-2">
                            <select class="form-control" name="categoryId">
                                <option value="">全部分类</option>
                                #for(category : categoryList)
                                <option value="#(category.id ??)" #selectedIf(category.id == numberPara('categoryId'))>#(category.layerString) #(category.title ??)</option>
                                #end
                            </select>
                        </div>

                        <div class="form-group col-lg-2">
                            <button type="submit" class="btn btn-primary ">查询</button>
                            <button type="reset" class="btn btn-default">重置</button>
                        </div>
                    </div>
                </form>
            </div>
            <div class="card-body p-0">

                <table class="table table-striped table-action">
                    <thead>
                    <tr>
                        <th style="width: 10px">
                            <input class="tableCheckAll" type="checkbox">
                        </th>
                        <th style="width: 100px">岗位名称</th>
                        <th style="width: 100px">分类</th>
                        <th style="width: 100px">招聘部门</th>
                        <th style="width: 100px">工作地点</th>
                        <th style="width: 100px">学历要求</th>
                        <th style="width: 100px">工作类型</th>
                        <th style="width: 100px">招聘类型</th>
                        <th style="width: 100px">招聘人数</th>
                    </tr>
                    </thead>
                    <tbody>


                    #for(entry : page.list ??)
                    <tr>
                        <td><input name="tableItem" type="checkbox" value="#(entry.id)"/>
                        </td>
                        <td style="width: 100px">
                            #(entry.title ??)

                            <div class="jp-action-card">
                                <div class="jp-action-body">
                                    <a href="#(entry.url ??)" target="_blank">预览</a> |
                                    <a href="#(CPATH)/admin/job/edit/#(entry.id)">编辑</a> |
                                    <a href="javascript:;" class="red-action"
                                       onclick="doDel('#(entry.id)')">删除</a>
                                </div>
                            </div>
                        </td>
                        <td>#(entry.category.title ??)</td>
                        <td>#maxLength(entry.department ??,5)</td>
                        <td>#(entry.address.title ??)</td>

                        <td>
                            #if(entry.education ?? == 0) 不限制学历
                            #else if(entry.education ?? == 1)初中及以下
                            #else if(entry.education ?? == 2)中专/中技
                            #else if(entry.education ?? == 3)高中
                            #else if(entry.education ?? == 4)大专
                            #else if(entry.education ?? == 5)本科
                            #else if(entry.education ?? == 6)硕士
                            #else if(entry.education ?? == 7)博士
                            #end
                        </td>

                        <td>
                            #if(entry.work_type ?? == 0) 全职
                            #else if(entry.work_type ?? == 1) 兼职
                            #else if(entry.work_type ?? == 2) 钟点工
                            #end
                        </td>

                        <td>
                            #if(entry.recruit_type ?? == 0) 社招
                            #else if(entry.recruit_type ?? == 1) 校招
                            #else if(entry.recruit_type ?? == 2) 实习
                            #end
                        </td>

                        <td>#(entry.recruit_numbers ??)</td>
                    </tr>
                    #end

                    </tbody>
                </table>


                <div class="card-footer">
                    <div class="row">
                        <div class="col-sm-6">
                            <div class="row">

                                <div class="form-group">
                                    <div class="form-check">
                                        <input class="form-check-input tableCheckAll" id="checkall" type="checkbox">
                                        <label class="form-check-label" for="checkall">全选</label>
                                    </div>
                                </div>
                                <div class="form-group col-lg-3">
                                    <select class="form-control" name="action">
                                        <option value="">请选择...</option>
                                        <option value="doDelByIds" open-type="del-confirm">
                                            批量删除
                                        </option>
                                    </select>
                                </div>

                                <div class="form-group col-lg-3">
                                    <button type="button" class="btn btn-outline-primary batchExec">批量操作</button>
                                </div>
                            </div>
                        </div>

                        <div class="col-sm-6">
                            #@_paginate()
                        </div>
                    </div>
                </div>

            </div>

        </div>
    </div>
</section>
#end
